package net.adetech.cjg.innerservice.controller;

import net.adetech.cjg.innerservice.utils.OcrUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OcrController {


    @RequestMapping(value = "/cjg/ocr",produces = "application/json")
    public String ocr(String base64,String path)
    {
        String result = null;
        if(base64!=null)
        {
           result = OcrUtil.readChar(base64);
        }

        if(path!=null)
        {
            path = "C:\\verifyCode\\"+path+".bmp";
            System.out.println(path);
            result = OcrUtil.readCharByPath(path);
        }
        return "{code:'"+result+"'}";
    }
}
